package cn.yunyichina.scheduler.jobs.service.register.callable;

import cn.yunyichina.provider.framework.dubbo.service.RegisterService;
import cn.yunyichina.provider.iface.entity.base.OrderExtVo;
import cn.yunyichina.provider.iface.entity.common.Response;
import cn.yunyichina.utils.convert.JsonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.concurrent.Callable;

/**
 * Created by Administrator on 2017/5/19.
 */
public class StopRegisterCall  implements Callable<List<OrderExtVo>> {
    private static final Logger logger = LoggerFactory.getLogger(StopRegisterCall.class);

    private String hospitalCode;
    private String branchCode;

    public StopRegisterCall(String hospitalCode, String branchCode) {
        this.hospitalCode = hospitalCode;
        this.branchCode = branchCode;
    }

    @Override
    public List<OrderExtVo> call() throws Exception {
        String data = "{\"hospital_code\":\"" + hospitalCode + "\",\"branch_code\":\"" + branchCode + "\"}";
        Response response =  RegisterService.callUnderlineFromInternal("yyt.register.stop.reg.loop",data);
        logger.info("StopRegisterCall yyt.register.stop.reg.loop,request={},response={}", JsonUtils.toJsonString(data),JsonUtils.toJsonString(response));
        return null;
    }
}
